package com.striker.nettyconn;

import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

@Configuration
@EnableMongoRepositories(basePackages = "com.striker.nettyconn")
public class MongoDBConfig {

    public @Bean MongoClient mongoClient() {
        return MongoClients.create("mongodb://myUserAdmin:Tmwamtf1@139.224.56.46:27017");
    }

    public @Bean
    MongoTemplate mongoTemplate() {
        return new MongoTemplate(mongoClient(), "test");
    }
}
